package com.zzl.spark.parquet;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.SQLContext;

public class ParquetPartitionDiscovery {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setMaster("local").setAppName("ParquetLoadData");
        JavaSparkContext sc = new JavaSparkContext(conf);
        System.setProperty("hadoop.home.dir", "E:\\hadoop");

        SQLContext sqlContext = new SQLContext(sc);
        Dataset<Row> parquet = sqlContext.read().parquet("hdfs://zhangzeli-node1:9000/users");

        parquet.printSchema();
        parquet.show();

        sc.stop();
    }
}
